﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DALScolarite
{
    public partial class scolarite_contextcohorts
    {
        uvtmoyEntities ent;
        public  scolarite_contextcohorts  contextcohorts(int idgroupe)
        {
            ent = new uvtmoyEntities();
            var query = (from s in ent.scolarite_contextcohorts
                         join e in ent.scolarite_groupeclass on s.idContextCohorts equals e.idContextCohorts 
                         where e.idGroupeClass == idgroupe
                         select s);
            if (query.Any())
            {

                return query.First();
            }
            else
            {
                return null;
            }
        }
    }
}
